//
// Created by Administrator on 2023/11/14.
//
#include "iostream"

using namespace std;

int main(){
    int n,m;
    cin>>n>>m;
    int A[n+1],B[n+1];

    for (int i = 1; i <= n; ++i) {
        cin>>A[i];
        B[i]=A[i]-A[i-1];
    }
    while(m--){
        int l,r,c;
        cin>>l>>r>>c;
        B[l]+=c;
        B[r+1]-=c;
    }
    for (int i = 1; i <= n; ++i) {
        A[i]=A[i-1]+B[i];
        cout<<A[i]<<' ';
    }

}